package com.jklan.zhiqibackend.common;

import lombok.Getter;

@Getter
public enum ErrorCode {
    // 用户模块 (1000-1999)
    USER_NOT_FOUND(1001, "用户不存在"),
    USER_ALREADY_EXISTS(1002, "用户已存在"),
    USERNAME_OR_PASSWORD_ERROR(1003, "用户名或密码错误"),
    EMAIL_ALREADY_REGISTERED(1004, "邮箱已被注册"),
    INVALID_LOGIN_CREDENTIALS(1005, "登录凭证无效"),
    
    // 个人仓库模块 (2000-2999)
    REPO_NOT_FOUND(2001, "仓库不存在"),
    REPO_ALREADY_EXISTS(2002, "仓库已存在"),
    REPO_CREATE_FAILED(2003, "创建仓库失败"),
    REPO_DELETE_FAILED(2004, "删除仓库失败"),
    
    // 团队模块 (3000-3999)
    TEAM_NOT_FOUND(3001, "团队不存在"),
    TEAM_ALREADY_EXISTS(3002, "团队已存在"),
    TEAM_CREATE_FAILED(3003, "创建团队失败"),
    USER_NOT_IN_TEAM(3004, "用户不在该团队中"),
    USER_ALREADY_IN_TEAM(3005, "用户已在该团队中"),
    
    // 团队仓库模块 (4000-4999)
    TEAM_REPO_NOT_FOUND(4001, "团队仓库不存在"),
    
    // 合同模块 (5000-5999)
    CONTRACT_NOT_FOUND(5001, "合同不存在"),
    CONTRACT_ALREADY_EXISTS(5002, "合同已存在"),
    
    // AI增强模块 (6000-6999)
    AI_SEARCH_FAILED(6001, "AI检索失败"),
    AI_QUESTION_ANSWER_FAILED(6002, "AI问答失败"),
    
    // 系统通用 (9000-9999)
    SYSTEM_ERROR(9001, "系统内部错误"),
    PARAMETER_INVALID(9002, "参数无效"),
    PERMISSION_DENIED(9003, "权限不足"),
    REQUEST_TIMEOUT(9004, "请求超时");
    
    private final int code;
    private final String message;
    
    ErrorCode(int code, String message) {
        this.code = code;
        this.message = message;
    }

}
